import { DataTypes } from "sequelize";
import sequelize from "./db";

export default sequelize.define('student_paper', {
  "test_paper_id": {
    type: DataTypes.UUID,
    allowNull: false,
  },

  'account_id': {
    type: DataTypes.STRING(10),
    primaryKey: false,
    allowNull: false,
  },

  'id': {
    type: DataTypes.UUID,
    allowNull: false,
    unique: true,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true
  },

  'answers': { // 学生答题题目的回答 {Questions_id, score, correct, answer，is_right}
    type: DataTypes.STRING(255),
    allowNull: false,
  },

  'score': {
    type: DataTypes.STRING(40),
    allowNull: true,
  },

}, {
  createdAt: false,
  updatedAt: false,
  freezeTableName: true
})